import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

import layout from '@/layout/index.vue'

import signinRoutes from './modules/signin'
import productRoutes from './modules/product'
import permissionRoutes from './modules/permission'
import articelRoutes from './modules/article'

import { House } from '@element-plus/icons'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: layout,
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/pages/home/index.vue'),
        name: 'Home',
        meta: {
          icon: House,
        },
      },
    ],
  },
  signinRoutes,
  productRoutes,
  permissionRoutes,
  articelRoutes,
]

const router = createRouter({
  routes,
  history: createWebHashHistory(),
})

export default router
